/**
 导航栏
 **/
(function(vc) {
    let DEFAULT_PAGE = 1;
    let DEFAULT_ROW = 10;
    var vm = new Vue({
        el: '#header',
        data: {
            headerInfo: {
                platformName: '',
                classes: [],
                informations: [],
                prodClasses: [],
                total:0,
                records:0
            },
            logo: '',
            userName: "",
        },
        mounted: function() {
          

        },
        methods: {
            _loadInformations: function() {
                let _that = this;
                let param = {
                    params: {
                        page: 1,
                        row: 100
                    }
                };
                //发送get请求
                vc.http.apiGet('/system.initPlatformData',
                    param,
                    function(json, res) {
                        let _homePageInfo = JSON.parse(json);
                        _that.headerInfo.total = _homePageInfo.total;
                        _that.headerInfo.records = _homePageInfo.records;
                        _that.headerInfo.informations = _homePageInfo.data.platformInformation;
                        _that.headerInfo.prodClasses = _homePageInfo.data.platformProductClass;
                        _that.headerInfo.platformName = _homePageInfo.data.platformName;
                    },
                    function(errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            getUserInfo: function() {
                //获取用户名
                let param = {
                    msg: '123',
                };
                //发送get请求
                vc.http.apiGet('/user.getUserInfo',
                    param,
                    function(json, res) {
                        if (res.status == 200) {
                            var tmpUserInfo = JSON.parse(json);
                            vm.userName = tmpUserInfo.name;
                            vm.nav.storeTypeCd = tmpUserInfo.storeTypeCd;
                            //加个水印
                            if (tmpUserInfo.watermark == 'true') {
                                vc.watermark({ watermark_txt: vc.i18n('systemName') + ":" + tmpUserInfo.name });
                            }
                        }
                    },
                    function() {
                        console.log('请求失败处理');
                    }
                );
            },
            _jumpToPage: function (_classId) {
                vc.jumpToPage("/pageLR.html#/pages/plateform/product?classId=" + _classId);
            }

        }
    });
    // vm.getUserInfo();
})(window.vc);